DROP TABLE CRST_AR_PAYMENT_SCHEDULES_ALL;

CREATE TABLE CRST_AR_PAYMENT_SCHEDULES_ALL
(
  PAYMENT_SCHEDULE_ID             NUMBER(15)    NOT NULL,
  STAGED_DUNNING_LEVEL            NUMBER(2),
  DUNNING_LEVEL_OVERRIDE_DATE     DATE,
  LAST_UPDATE_DATE                DATE          NOT NULL,
  LAST_UPDATED_BY                 NUMBER(15)    NOT NULL,
  CREATION_DATE                   DATE          NOT NULL,
  CREATED_BY                      NUMBER(15)    NOT NULL,
  LAST_UPDATE_LOGIN               NUMBER(15),
  DUE_DATE                        DATE          NOT NULL,
  AMOUNT_DUE_ORIGINAL             NUMBER        NOT NULL,
  AMOUNT_DUE_REMAINING            NUMBER        NOT NULL,
  NUMBER_OF_DUE_DATES             NUMBER(15)    NOT NULL,
  STATUS                          VARCHAR2(30 BYTE) NOT NULL,
  INVOICE_CURRENCY_CODE           VARCHAR2(15 BYTE) NOT NULL,
  CLASS                           VARCHAR2(20 BYTE) NOT NULL,
  CUST_TRX_TYPE_ID                NUMBER(15),
  CUSTOMER_ID                     NUMBER(15),
  CUSTOMER_SITE_USE_ID            NUMBER(15),
  CUSTOMER_TRX_ID                 NUMBER(15),
  CASH_RECEIPT_ID                 NUMBER(15),
  ASSOCIATED_CASH_RECEIPT_ID      NUMBER(15),
  TERM_ID                         NUMBER(15),
  TERMS_SEQUENCE_NUMBER           NUMBER(15),
  GL_DATE_CLOSED                  DATE          NOT NULL,
  ACTUAL_DATE_CLOSED              DATE          NOT NULL,
  DISCOUNT_DATE                   DATE,
  AMOUNT_LINE_ITEMS_ORIGINAL      NUMBER,
  AMOUNT_LINE_ITEMS_REMAINING     NUMBER,
  AMOUNT_APPLIED                  NUMBER,
  AMOUNT_ADJUSTED                 NUMBER,
  AMOUNT_IN_DISPUTE               NUMBER,
  AMOUNT_CREDITED                 NUMBER,
  RECEIVABLES_CHARGES_CHARGED     NUMBER,
  RECEIVABLES_CHARGES_REMAINING   NUMBER,
  FREIGHT_ORIGINAL                NUMBER,
  FREIGHT_REMAINING               NUMBER,
  TAX_ORIGINAL                    NUMBER,
  TAX_REMAINING                   NUMBER,
  DISCOUNT_ORIGINAL               NUMBER,
  DISCOUNT_REMAINING              NUMBER,
  DISCOUNT_TAKEN_EARNED           NUMBER,
  DISCOUNT_TAKEN_UNEARNED         NUMBER,
  IN_COLLECTION                   VARCHAR2(1 BYTE),
  CASH_APPLIED_ID_LAST            NUMBER,
  CASH_APPLIED_DATE_LAST          DATE,
  CASH_APPLIED_AMOUNT_LAST        NUMBER,
  CASH_APPLIED_STATUS_LAST        VARCHAR2(30 BYTE),
  CASH_GL_DATE_LAST               DATE,
  CASH_RECEIPT_ID_LAST            NUMBER(15),
  CASH_RECEIPT_DATE_LAST          DATE,
  CASH_RECEIPT_AMOUNT_LAST        NUMBER,
  CASH_RECEIPT_STATUS_LAST        VARCHAR2(30 BYTE),
  EXCHANGE_RATE_TYPE              VARCHAR2(30 BYTE),
  EXCHANGE_DATE                   DATE,
  EXCHANGE_RATE                   NUMBER,
  ADJUSTMENT_ID_LAST              NUMBER(15),
  ADJUSTMENT_DATE_LAST            DATE,
  ADJUSTMENT_GL_DATE_LAST         DATE,
  ADJUSTMENT_AMOUNT_LAST          NUMBER,
  FOLLOW_UP_DATE_LAST             DATE,
  FOLLOW_UP_CODE_LAST             VARCHAR2(30 BYTE),
  PROMISE_DATE_LAST               DATE,
  PROMISE_AMOUNT_LAST             NUMBER,
  COLLECTOR_LAST                  NUMBER(15),
  CALL_DATE_LAST                  DATE,
  TRX_NUMBER                      VARCHAR2(30 BYTE),
  TRX_DATE                        DATE,
  ATTRIBUTE_CATEGORY              VARCHAR2(30 BYTE),
  ATTRIBUTE1                      VARCHAR2(150 BYTE),
  ATTRIBUTE2                      VARCHAR2(150 BYTE),
  ATTRIBUTE3                      VARCHAR2(150 BYTE),
  ATTRIBUTE4                      VARCHAR2(150 BYTE),
  ATTRIBUTE5                      VARCHAR2(150 BYTE),
  ATTRIBUTE6                      VARCHAR2(150 BYTE),
  ATTRIBUTE7                      VARCHAR2(150 BYTE),
  ATTRIBUTE8                      VARCHAR2(150 BYTE),
  ATTRIBUTE9                      VARCHAR2(150 BYTE),
  ATTRIBUTE10                     VARCHAR2(150 BYTE),
  REVERSED_CASH_RECEIPT_ID        NUMBER(15),
  AMOUNT_ADJUSTED_PENDING         NUMBER,
  ATTRIBUTE11                     VARCHAR2(150 BYTE),
  ATTRIBUTE12                     VARCHAR2(150 BYTE),
  ATTRIBUTE13                     VARCHAR2(150 BYTE),
  ATTRIBUTE14                     VARCHAR2(150 BYTE),
  ATTRIBUTE15                     VARCHAR2(150 BYTE),
  GL_DATE                         DATE          NOT NULL,
  ACCTD_AMOUNT_DUE_REMAINING      NUMBER        NOT NULL,
  PROGRAM_APPLICATION_ID          NUMBER(15),
  PROGRAM_ID                      NUMBER(15),
  PROGRAM_UPDATE_DATE             DATE,
  RECEIPT_CONFIRMED_FLAG          VARCHAR2(1 BYTE),
  REQUEST_ID                      NUMBER(15),
  SELECTED_FOR_RECEIPT_BATCH_ID   NUMBER(15),
  LAST_CHARGE_DATE                DATE,
  SECOND_LAST_CHARGE_DATE         DATE,
  DISPUTE_DATE                    DATE,
  ORG_ID                          NUMBER(15),
  GLOBAL_ATTRIBUTE1               VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE2               VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE3               VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE4               VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE5               VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE6               VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE7               VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE8               VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE9               VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE10              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE11              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE12              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE13              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE14              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE15              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE16              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE17              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE18              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE19              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE20              VARCHAR2(150 BYTE),
  GLOBAL_ATTRIBUTE_CATEGORY       VARCHAR2(30 BYTE),
  CONS_INV_ID                     NUMBER(15),
  CONS_INV_ID_REV                 NUMBER(15),
  EXCLUDE_FROM_DUNNING_FLAG       VARCHAR2(1 BYTE),
  MRC_CUSTOMER_TRX_ID             VARCHAR2(2000 BYTE),
  MRC_EXCHANGE_RATE_TYPE          VARCHAR2(2000 BYTE),
  MRC_EXCHANGE_DATE               VARCHAR2(2000 BYTE),
  MRC_EXCHANGE_RATE               VARCHAR2(2000 BYTE),
  MRC_ACCTD_AMOUNT_DUE_REMAINING  VARCHAR2(2000 BYTE),
  BR_AMOUNT_ASSIGNED              NUMBER,
  RESERVED_TYPE                   VARCHAR2(30 BYTE),
  RESERVED_VALUE                  NUMBER(15),
  PAYMENT_SCHEDULE_ID_N           NUMBER(15)
);
